﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace App10.ViewModels
{
    public class MainPageViewModel
    {
        public MainPageViewModel()
        {
            // sample data
            var posts = Enumerable.Range(1, 50)
                .Select(i => new Models.Post
                {
                    Title = "Post Title " + i.ToString(),
                    Text = "Now is the time for all good men to come to the aid of their country.",
                    Date = DateTime.Now
                });
            foreach (var item in posts)
                this.Posts.Add(item);
        }

        ObservableCollection<Models.Post> _Posts = new ObservableCollection<Models.Post>();
        public ObservableCollection<Models.Post> Posts { get { return _Posts; } }
    }
}
